
local fromAccount = KEYS[1]
local toAccount = KEYS[2]
local fromBalance = tonumber(redis.call('HGET', 'user', fromAccount))
local toBalance = tonumber(redis.call('HGET', 'user', toAccount))
local amount = tonumber(ARGV[1])
if fromBalance >= amount
then
    local account1 = string.format("%.2f", fromBalance - amount)
    local account2 = string.format("%.2f", toBalance + amount)
    redis.call('HSET', 'user', fromAccount, account1)
    redis.call('HSET', 'user', toAccount, account2)
    return true
end
return false